<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org" lang="en">
<head>
    <title>麻将社区 -- 1.0</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <link rel="stylesheet" type="text/css" href="/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="/css/bootstrap-theme.min.css">
    <link rel="stylesheet" type="text/css" href="/css/community.css">
    <script type="application/javascript" src="/js/jquery.min.js"></script>
    <script type="application/javascript" src="/js/bootstrap.min.js"></script>

</head>
<script type="application/javascript">
    window.onload = function () {
        var closable = window.localStorage.getItem("closable");
        if (closable == "true") {
            window.close();
            window.localStorage.removeItem("closable");
        }
    }
</script>
<body>
<div th:insert="navigation :: nav"></div>
<div class="container-fluid main">
    <div class="row">
        <!--左侧主栏-->
        <div class="col-lg-9 col-md-12 col-sm-12 col-xs-12">
            <h2><span class="glyphicon glyphicon-list" aria-hidden="true"></span> 发现 </h2>
            <hr class="hr-sp-down">
            <!--标签排序选择-->
            <ul class="nav nav-tabs">
                <li role="presentation"><a href="/index?sortedBy=latest">最新</a></li>
                <li role="presentation"><a href="/index?sortedBy=weekly-popular">一周热点</a></li>
                <li role="presentation"><a href="/index?sortedBy=monthly-popular">月度热点</a></li>
                <li role="presentation"><a href="/index?sortedBy=most-popular">最热</a></li>
                <li role="presentation"><a href="/index?sortedBy=eliminate-zero-recovery" class="a-font-color">消灭零回复</a></li>
            </ul>
            <div class="media span-sp-up" th:each="question : ${pagination.data}"
                 th:if="${pagination.data.size() != 0}">
                <div class="media-left">
                    <a th:href="@{'/question/'+${question.id}}">
                        <img class="media-object img-rounded img-size" th:src="${question.user.avatarUrl}">
                    </a>
                </div>
                <div class="media-body">
                    <h4 class="media-heading">
                        <a th:href="@{'/question/'+${question.id}}" th:text="${question.title}"></a>
                    </h4>
                    <p id="show-description" class="line-limit-length span-sp-up span-sp-down description-font-style"
                       th:text="${question.description}"></p>
                    <span class="text-desc">
                        <span th:text="${question.commentCount}"></span> 个回复 • <span
                            th:text="${question.viewCount}"></span> 次浏览 • 发布时间 <span
                            th:text="${#dates.format(question.gmtCreate, 'yyyy-MM-dd HH:mm')}"></span>
                    </span>
                </div>
                <hr class="span-sp-up span-sp-down">
            </div>
            <nav aria-label="Page navigation">
                <ul class="pagination">
                    <li th:if="${pagination.showFirstPage}">
                        <a th:href="@{/index(page=${1}, sortedBy=${sortedBy})}" aria-label="Previous">
                            <span aria-hidden="true">&lt;&lt;</span>
                        </a>
                    </li>
                    <li th:if="${pagination.showPrevious}">
                        <a th:href="@{/index(page=${pagination.page - 1}, sortedBy=${sortedBy})}" aria-label="Previous">
                            <span aria-hidden="true">&lt;</span>
                        </a>
                    </li>
                    <li th:each="page : ${pagination.pages}" th:class="${pagination.page == page} ? 'active' : ''">
                        <a th:href="@{/index(page=${page}, sortedBy=${sortedBy})}" th:text="${page}"></a>
                    </li>
                    <li th:if="${pagination.showNext}">
                        <a th:href="@{/index(page=${pagination.page + 1}, sortedBy=${sortedBy})}" aria-label="Next">
                            <span aria-hidden="true">&gt;</span>
                        </a>
                    <li th:if="${pagination.showEndPage}">
                        <a th:href="@{/index(page=${pagination.totalPage}, sortedBy=${sortedBy})}" aria-label="Next">
                            <span aria-hidden="true">&gt;&gt;</span>
                        </a>
                    </li>
                    </li>
                </ul>
            </nav>
        </div>
        <!--右侧副栏-->
        <div class="col-lg-3 col-md-12 col-sm-12 col-xs-12">
            <!--广告区域-->
            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 div-sp-up">
                <h4>站长QQ</h4>
                <img src="/img/QQ_Lizhen.JPG" alt="Author' s image has failed to reveal..." class="img-thumbnail">
                <hr class="hr-sp-up">
            </div>
            <!--热门话题-->
            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <h4>热门话题</h4>
                <span class="span-sp-up">
                    <span class="label label-info span-style span-sp-right"
                          th:each="tag : ${hotTags}">
                        <a class="tag-style" th:href="@{/search(tag=${tag})}" th:text="${tag}"></a>
                    </span>
                </span>
            </div>
        </div>
    </div>
</div>
<div th:insert="footer :: footer"></div>
</body>
</html>